package net.ibizsys.eclipse.studio.xml;

import java.text.Collator;
import java.util.Comparator;

/**
 * 
 * @author <a href='http://www.weibo.com/xjtoo' target='_blank'>Enmaai</a>
 */
public class XmlNodeTextComparator<T extends XmlNode> implements Comparator<T>
{
	private Collator collator = null;

	public XmlNodeTextComparator()
	{
		this.collator = Collator.getInstance(java.util.Locale.CHINA);
	}

	@Override
	public int compare(T arg0, T arg1)
	{
		return collator.compare(arg0.getText(), arg1.getText());
	}
}
 